#include "maqgraphicsscene.h"

#include "maqgraphicsview.h"
#include "iostream"

MaQGraphicsScene::MaQGraphicsScene(QRect rect,QWidget * vue):
    QGraphicsScene(rect,vue)
{
    MaQGraphicsView *maVue = (MaQGraphicsView*)vue;
    QObject::connect(maVue,SIGNAL(mousePressPosChanged(QPoint)),this,SLOT(pressEvent(QPoint)));
    QObject::connect(maVue,SIGNAL(mouseMovePosChanged(QPoint)),this,SLOT(moveEvent(QPoint)));
    QObject::connect(maVue,SIGNAL(mouseReleasePosChanged(QPoint)),this,SLOT(releaseEvent(QPoint)));
}

MaQGraphicsScene::~MaQGraphicsScene()
{
}



void MaQGraphicsScene::pressEvent(QPoint point){
    emit mousePress(point);
}

void MaQGraphicsScene::moveEvent(QPoint point){
    emit mouseMove(point);
}

void MaQGraphicsScene::releaseEvent(QPoint point){
    emit mouseRelease(point);
}


